﻿using Loki.UI.Wpf;

namespace Luna.UI.Budget.Wpf
{
    /// <summary>
    /// Logique d'interaction pour CategoryList.xaml
    /// </summary>
    public partial class CategoryListView : ViewControl<CategoryListViewModel>
    {
        public CategoryListView()
        {
            InitializeComponent();
            DataContextChanged += CategoryListView_DataContextChanged;
        }

        private void CategoryListView_DataContextChanged(object sender, System.Windows.DependencyPropertyChangedEventArgs e)
        {
            GRD_Categories.ConfigureGrid();

            COL_Name.Bind<DisplayableCategory>(x => x.Name);
            COL_Description.Bind<DisplayableCategory>(x => x.Description);
            COL_Color.Bind<DisplayableCategory>(x => x.Color);
        }
    }
}